package com.example.news.utils.result;

import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * 统一返回结果状态信息类
 *
 */
public enum ResultCodeEnum {

    SUCCESS(200,"success"),
    SYSTEM_ERROR(500,"系统错误！"),
    USERNAME_ERROR(501,"用户名错误！"),
    CAPTCHA_ERROR(502,"验证码错误！"),
    PASSWORD_ERROR(503,"密码错误！"),

    NOTLOGIN(504,"token无效！"),
    USERNAME_USED(505,"用户名已被使用！"),
    EMAIL_USED(506,"邮箱已被使用！"),
    LOGIN_EMAIL_ERROR(507,"邮箱未绑定！"),

    USER_ERROR(510,"用户不存在！");

    private Integer code;
    private String message;
    private ResultCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
    public Integer getCode() {
        return code;
    }
    public String getMessage() {
        return message;
    }
}
